<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>阳光普照奖控制</title>

    <script src="plugins/jquery-3.1.1.min.js"></script>
</head>
<body>

<script>
    var yearmeeting = "/yearmeeting/";
    function ajax(url, param, type, contentType) {
        return $.ajax({
            url: url,
            data: param || {},
            type: type || 'GET',
            contentType: contentType || 'application/x-www-form-urlencoded'
        })
    }

    function sendSunState(sunState) {
        var r=confirm("确认要修改阳光普照奖状态么");
        if(r == true){
            var ip = window.location.host;
            var url = "";
            ajax(yearmeeting + 'rest/sun/sunState', {
                "sunState": sunState
            }, 'POST').done(function(res) {
                alert("修改结果："+res.callBackState+"，当前状态:"+res.sunState);
            }).fail(function(err) {
                errMsg(err);
            });
        }else{
            return falsel;
        }
    }
</script>
<button onclick="sendSunState('reset')" value="重置" >重置阳光普照奖</button><br/><br/>
<button onclick="sendSunState('start')" value="重置" >开始阳光普照奖</button><br/><br/>
<button onclick="sendSunState('stop')" value="重置" >结束阳光普照奖</button><br/><br/>

</body>
</html>